import {
  Controller,
  Get,
  Queries,
  Query,
  Request,
  Route,
  ValidateParam,
} from "tsoa";

interface Project {
  name: string | "type";
  desc: string;
}

interface ReqParam {
    /**
     * 用户名称
     */
  name: string;
  /**
   * 年龄
   */
  age?: number;
}

@Route("project")
export class ProjectController extends Controller {
  @Get("/all")
  public async getAllProjects(): Promise<Project> {
    return {
      name: "心愿项目",
      desc: "生活多姿多彩，存一笔钱如何",
    };
  }

  @Get("/demo")
  public async demo(@Queries() param: ReqParam): Promise<Project> {
    console.log(param);
    return {
      name: "心愿项目",
      desc: "生活多姿多彩，存一笔钱如何",
    };
  }
}
